package com.design.pattern.command.projection2;

import java.util.List;

/**
 * 渠道
 */
public  class ConcretetCommandChannel implements CommandChannel{
    private List<CommandExecutor> executors;

    public ConcretetCommandChannel(List<CommandExecutor> executors) {
        this.executors = executors;
    }

    /**
     * 执行命令
     * @param command 命令
     */
    @Override
    public void spreadTheOrder(Command command) {
        for (CommandExecutor executor:executors){
            executor.execute(command);
        }
    }
}
